package org.other.test1720;

/**
 * @Author yu
 * @Date 2022/7/6
 */
public class Demo {

    public static void main(String[] args) {

        int[] ints = {10, 1, 5, 4, 7};
        System.out.println(method(ints));

        Integer i1 = 1;
        Integer i2 = new Integer(1);
        Integer i3 = Integer.valueOf(1);
        System.out.println(i2 == i3);
        System.out.println(i1 == i3);

        String a = "aaa";
        String b = String.valueOf("aaa");
        System.out.println(a == b);


    }

    public static int method(int[] ints) {

        int max = 0;
        for (int i = 0; i < ints.length - 1; i++) {
            for (int j = i + 1; j < ints.length; j++) {
                max = Math.max(ints[j] - ints[i], max);
            }
        }
        return max;
    }

}
